﻿using System;
using FNN.Factories.SourcePoints;
using FNN.Helpers.DataSource;
using FNN.Helpers.IO;
using FNN.Networks;

namespace FNN.Factories.Helpers
{
    public class DataSourceHelperFactory
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="masterType"></param>
        /// <param name="filePath"></param>
        /// <returns></returns>
        public static DataSourceHelper CreateHelper(NetworkTypes masterType, string filePath)
        {
            switch (masterType) {
                case NetworkTypes.Financial:
                    return new DataSourceHelper(
                        new CsvHelper(filePath),
                        new DateSourcePointFactory()
                        );
                case NetworkTypes.Regular:
                    return new DataSourceHelper(
                        new CsvHelper(filePath),
                        new CategorySourcePointFactory()
                        );
            }
            throw new ArgumentOutOfRangeException("masterType", "Unknown master type!");
        }
    }
}
